package com.teradata.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.Date;

@Controller
public class FreeMarkerController {

    @GetMapping("/ftl/home")
    public String home(){
        return "home";
    }

    @GetMapping("/ftl/home1")
    public String home1(Model model){
        model.addAttribute("time", new Date(System.currentTimeMillis()));
        return "home1";
    }

    @GetMapping("/ftl/home2")
    public ModelAndView home2() {
        ModelAndView modelAndView = new ModelAndView("home1");
        modelAndView.addObject("time", new Date(System.currentTimeMillis()));
        return  modelAndView;
    }
}
